package com.foreveross.taskservice.web.controller.task;

import java.util.List;

import org.dayatang.domain.InstanceFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.foreveross.taskservice.application.statistics.EngineStatisticsHistoryApplication;
import com.foreveross.taskservice.application.task.statsdetail.ICrawlStatsApplication;
import com.foreveross.taskservice.application.task.statsdetail.vo.CrawlStatsVO;
import com.foreveross.taskservice.web.controller.auth.BaseController;
import com.google.common.collect.Lists;

/**
 * 测试持久化
*/
//@Controller
@RequestMapping("/task/CrawlStats")
public class TestAction extends BaseController{
	
	@RequestMapping("/testA")
	public void testA() {
		try {
			//测试mysql持久化
			List<CrawlStatsVO> vos =Lists.newArrayList();
			//List<CrawlStatsVO> vos=crawlStatsApplication.getAllChannelCrawlSuccessStats();
			vos=InstanceFactory.getInstance(ICrawlStatsApplication.class).showAllChannelCrawlSuccessStats();
			if(vos.size()>0){
				InstanceFactory.getInstance(EngineStatisticsHistoryApplication.class).addDataByDate(vos);	
			}
			//测试hbase持久化
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
